package org.millioncall.yueyoga.admin.dao;

import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.model.AviatorExpression;
import org.millioncall.yueyoga.admin.model.ConsumeHistoryModel;
import org.millioncall.yueyoga.admin.model.Product;

public interface ProductDAO {
	public void clearWeeklyUseTimes();

	public Product findById(Map<String, Object> map);

	public PaginatedList<Product> findInPage(Map<String, Object> map,
			int pageNo, int pageSize);

	public PaginatedList<Product> findInPage(int pageNo, int pageSize);

	public int save(Product product);

	public int update(Product product);

	public int delete(Product product);

	public int deleteByIds(String[] ids);

	public PaginatedList<Product> findAll();

	public PaginatedList<ConsumeHistoryModel> findAllConsumeHistory(
			Map<String, Object> params, Integer pageNo, Integer pageSize);

	public PaginatedList<ConsumeHistoryModel> findAllAbsentForSomeDays(
			Map<String, Object> params, Integer pageNo, Integer pageSize);

	public PaginatedList<Product> findProductAvailable(int pageNo,
			int pageSize, Map<String, Object> map);

	public List<Product> findProductAvailableAll(Map<String, Object> map);

	public PaginatedList<Product> findByMemberIdInPage(Integer memberId,
			int start, int limit);

	public PaginatedList<Product> findProductAvailable(Map<String, Object> map,
			int pageNo, int pageSize);

	public PaginatedList<Product> findMemberInfoInPage(Map<String, Object> map,
			Integer start, Integer limit);

	public List<Product> findByMemberId(Map<String, Object> map);

	/**
	 * 查询所有符合aviator表达式的产品
	 * 
	 * @param expression
	 * @param params
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<Product> getAllProductsWithAviator(Map<String, Object> params,
			AviatorExpression expression, Map<String, Object> aviatorParams,
			int limit);

}
